<?php
namespace app\serverorder\validate;
use \app\manage\validate\BaseValidate;

/**
 * @author:      李颖
 * @DateTime:    2017-10-13 11:56:17
 * @Description: 订单模块
 */


class Order extends BaseValidate
{
    
	protected $rule =   [
        'user_id' => ['integer', 'gt'=>0],
        'order_auto_close' => ['integer', 'gt'=>0],
        'goods_id' => ['integer', 'gt'=>0],
        'number' => ['integer', 'gt'=>0],
        'goods_info' => ['array'],
        'goods_attrs' => ['array'],
        'order_code' => ['min'=>2],
        'status' => ['in'=>'0,1'],
        'integral_deduction' => ['integer', 'egt'=>0],
        'integral_deduction_money' => ['integer', 'egt'=>0],
        'integral_deduction_currency' => ['number', 'egt'=>0],
        //检验商品信息
        'id' => ['integer', 'gt'=>0],
        'title' => ['min'=>2],
        'price' => ['integer', 'gt'=>0],
        'product_code' => ['min'=>2],
        'cartList' => ['array', 'min'=>1],
        'pay_method' => ['in'=>'cash,currency,alipay,wechat,unionpay'],
        'final_price' => ['integer', 'gt'=>0],
        'final_currency_price' => ['number', 'egt'=>0],
    ];

    protected $message  =   [
        
    ];

    protected $scene = [
    	'checkGoodsInfo' => [
    		'id' => ['require','integer', 'gt'=>0],
    		'user_id' => ['require','integer', 'gt'=>0],
    		'title' => ['require','min'=>2],
    		'price' => ['require','integer', 'gt'=>0],
            'product_code' => ['require', 'min'=>2],
    	],
        'myOrderList' => [
            'user_id' => ['require', 'integer', 'gt'=>0],
            'status' => ['in'=>'0,1'],
        ],
    ];



}
